<template>
  <div class="app">
    <h2>我是App组件</h2>
    <Child 
      :str="str" 
      :updateStr="updateStr" 
    />
  </div>
</template>

<script>
import Child from "./components/Child";

export default {
  name: "App",
  components: { Child },
  data() {
    return {
      str: "你好啊",
    };
  },
  methods: {
    updateStr(value) {
      this.str = value;
    }
  },
};
</script>

<style scoped>
.app {
  background-color: gray;
  padding: 10px;
}
</style>